<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<meta charset="UTF-8" />
<title>餐桌</title>
</head>
<body>
	<div th:replace="header :: header"></div>
	<h1>餐桌预定</h1>
	<div id="dinnerTable">
		<form method="post" action="foodList">
			<table border="1">
				<thead>
					<tr>
						<th>餐桌号</th>
						<th>餐桌名</th>
						<th>餐桌状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tr th:each="dinnerTable : ${dinnerTables}">
					<td id="id" th:text="${dinnerTable.id}"></td>
					<td id="tableName" th:text="${dinnerTable.tableName}"></td>
					<td id="tableStatus" class="tableStatus"
						th:text="${dinnerTable.tableStatus}"></td>
					<td>
						<!-- <a><button>预定</button></a>&nbsp; --> <a href="book"><button
								class="entityTable">预定</button></a>
					<!-- status为0时 -->
						<button class="fullTable">使用中</button>&nbsp; <button
								class="order" type="submit" onclick="checkTable()">点餐</button>
					</td>
				</tr>
			</table>
		</form>
	</div>
<script src="/js/test.js" type="text/javascript"></script>
<script type="text/javascript">
$(window).load(function(){
	$(".order").click(function(){
		var id = $(this).parent().siblings().eq(0).text();
		//alert(id);
		
	})
})
</script> 
</body>

</html>